C   IMSL ROUTINE NAME   - LUELMN                                        LUEN0010
C                                                                       LUEN0020
C-----------------------------------------------------------------------LUEN0030
C                                                                       LUEN0040
C   COMPUTER            - HP1000/SINGLE                                 LUEN0050
C                                                                       LUEN0060
C   LATEST REVISION     - JUNE 1, 1982                                  LUEN0070
C                                                                       LUEN0080
C   PURPOSE             - NUCLEUS CALLED ONLY BY IMSL SUBROUTINE LEQT2F LUEN0090
C                                                                       LUEN0100
C   REQD. IMSL ROUTINES - NONE REQUIRED                                 LUEN0110
C                                                                       LUEN0120
C   NOTATION            - INFORMATION ON SPECIAL NOTATION AND           LUEN0130
C                           CONVENTIONS IS AVAILABLE IN THE MANUAL      LUEN0140
C                           INTRODUCTION OR THROUGH IMSL ROUTINE UHELP  LUEN0150
C                                                                       LUEN0160
C   COPYRIGHT           - 1982 BY IMSL, INC. ALL RIGHTS RESERVED.       LUEN0170
C                                                                       LUEN0180
C   WARRANTY            - IMSL WARRANTS ONLY THAT IMSL TESTING HAS BEEN LUEN0190
C                           APPLIED TO THIS CODE. NO OTHER WARRANTY,    LUEN0200
C                           EXPRESSED OR IMPLIED, IS APPLICABLE.        LUEN0210
C                                                                       LUEN0220
C-----------------------------------------------------------------------LUEN0230
C                                                                       LUEN0240
      SUBROUTINE LUELMN (A,IA,N,B,APVT,X)                               LUEN0250
C                                                                       LUEN0260
      DIMENSION          A(IA,1),B(1),APVT(1),X(1)                      LUEN0270
C                                  FIRST EXECUTABLE STATEMENT           LUEN0280
C                                  SOLVE LY = B FOR Y                   LUEN0290
      DO 5 I=1,N                                                        LUEN0300
    5 X(I) = B(I)                                                       LUEN0310
      IW = 0                                                            LUEN0320
      DO 20 I=1,N                                                       LUEN0330
         IP = APVT(I)                                                   LUEN0340
         SUM = X(IP)                                                    LUEN0350
         X(IP) = X(I)                                                   LUEN0360
         IF (IW .EQ. 0) GO TO 15                                        LUEN0370
         IM1 = I-1                                                      LUEN0380
         DO 10 J=IW,IM1                                                 LUEN0390
            SUM = SUM-A(I,J)*X(J)                                       LUEN0400
   10    CONTINUE                                                       LUEN0410
         GO TO 20                                                       LUEN0420
   15    IF (SUM .NE. 0.) IW = I                                        LUEN0430
   20 X(I) = SUM                                                        LUEN0440
C                                  SOLVE UX = Y FOR X                   LUEN0450
      DO 30 IB=1,N                                                      LUEN0460
         I = N+1-IB                                                     LUEN0470
         IP1 = I+1                                                      LUEN0480
         SUM = X(I)                                                     LUEN0490
         IF (IP1 .GT. N) GO TO 30                                       LUEN0500
         DO 25 J=IP1,N                                                  LUEN0510
            SUM = SUM-A(I,J)*X(J)                                       LUEN0520
   25   CONTINUE                                                        LUEN0530
   30 X(I) = SUM/A(I,I)                                                 LUEN0540
      RETURN                                                            LUEN0550
      END                                                               LUEN0560
